namespace Framework.UI
{
	public partial class CreateRoomEditFrame : UIFrame
	{
        protected override void OnFrameOpen()
        {
			EventDispatchManager.Instance.AddEvent(EventId.Game.EVENT_ROOM_CREATED, OnEventRoomCreated);
        }

		void OnEventRoomCreated(IEventArgv eventArgv)
        {
			UIFrameManager.Instance.CloseFrame(this);
        }

        protected override void OnFrameClose()
        {
			EventDispatchManager.Instance.RemoveEvent(EventId.Game.EVENT_ROOM_CREATED, OnEventRoomCreated);
		}
        string roomName;
		void OnInputRoomNameEndEdit(string inputRoomName)
		{
            //Add Your Code Here
            roomName = inputRoomName;
        }
		string roomPassword;
		void OnInputRoomPasswordEndEdit(string inputRoomPassword)
		{
            //Add Your Code Here
            roomPassword = inputRoomPassword;
        }
		void OnBtnOKClicked()
		{
			//Add Your Code Here
			if(string.IsNullOrEmpty(roomName))
			{
				SLogger.E("Room Name Can Not Be Empty !!!");
				return;
			}
			Net.SendReqCreateRoomMessage(roomName,roomPassword);
		}
		void OnBtnCloseClicked()
		{
            //Add Your Code Here
            UIFrameManager.Instance.CloseFrame(this);
        }
	}
}
